home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / allocwg.com / FREE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1988-11-10  |  1.2 KB  |  54 lines

  1. #ifndef MSC
  2.  
  3.     /*  Non-MSC Version  */
  4.  
  5. #if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
  6.  
  7.     /*  NOTE:  These procedures should only be used for
  8.                large data model programs (i.e., Compact, Large, Huge) */
  9.  
  10. #include <stddef.h>
  11. #include "alloc.h"
  12.  
  13. void  free ( ap )
  14.  
  15.    void *ap  ;         /*  Pointer to block to be free'ed  */
  16.  
  17. /*
  18.          +---------------------------------------+
  19.          |                                       |  
  20.          |  Put block ap in free list            |  
  21.          |                                       |  
  22.          +---------------------------------------+
  23. */
  24.  
  25. {
  26.    HEADER *Header        ;
  27.    HEADER *CheckBlock () ;
  28.    SUNIT   offset        ;
  29.  
  30.    if ((Header = CheckBlock ( ap, &offset )) == NULL )
  31.       return ;
  32.  
  33.    *( (SUNIT *)ap - 1 ) |= FREE  ;
  34.    Header->Collapsed     = FALSE ;
  35. }
  36.  
  37. void _ffree ( ap )
  38.  
  39.    void  far *ap  ;
  40.  
  41. /*
  42.          +---------------------------------------+
  43.          |                                       |  
  44.          |  Interface to free (large data)       |  
  45.          |                                       |  
  46.          +---------------------------------------+
  47. */
  48.  
  49. {
  50.    free ( (void *) ap ) ;
  51. }
  52. #endif
  53. #endif
  54.